package com.jiawa.wiki.controller;

import com.jiawa.wiki.domain.Ebook;
import com.jiawa.wiki.req.EbookReq;
import com.jiawa.wiki.service.EbookService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import resp.CommonResp;
import resp.EbookResp;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/ebook")
public class EbookController {
    
    

    //依赖注入
    @Resource
    public EbookService ebookService;

    @GetMapping("/list")

    public CommonResp list(EbookReq req){
        List<EbookResp> list= ebookService.getlist(req);

        CommonResp<List<EbookResp>> resp = new CommonResp<>();

        resp.setContent(list);
        return resp;

    }
}
